<template>
	<view>
		
	</view>
</template>

<script>
	export default {
		components: { },
		data() {
			return {
				
			}
		},
		onShow(){
			let _this = this;
			_this.handleSugoioLoad(undefined, 'guest-oauth2')
		},
		onLoad(e) {
			
			var code = this.$common.getRequest("code");
			if (code) {
				//获取用户信息
				var addOptions = {
					url: "getUserId",
					data: { code: code },
					success: (res)=> {
						if (res.flag == 0) {
							this.$users.setInfo({
								ID: res.data
							});
							uni.redirectTo({ url: "../index/index"});
						}else{
							this.$common.alert(res.msg);
						}
					}
				}
				this.$common.initAjax(addOptions);
			} else {
				this.$common.removeStorage("UserInfo");
				this.$common.alert("用户授权失败，请重新进入！");
			}
		},
		methods: {
		}
	}
</script>

<style>
	
</style>
